<?php
class CmsAction extends Action{
	
	function help(){
		$map = $this->_dealList(6);
		$list = D('Cms')->where($map)->order('id asc')->findPage(10);	

		$this->assign('list',$list['data']);
		$this->assign('html',$list['html']);
				
		$this->display();
	}
	
	function notice(){
		$map = $this->_dealList(59);
		$list = D('Cms')->where($map)->order('id desc')->findPage(10);	

		$this->assign('list',$list);	
		$this->display();
	}

	function _dealList($cid){
		//获取总分类
		$cate = D('Cms')->_makeTree($cid);
		$this->assign('category',$cate);

		$categoryId = $_GET['cid'] ? intval($_GET['cid']) : $cate[0]['a'];
		$this->assign('cid',$categoryId);
		$this->assign('title',getCmsCateTitle($categoryId));
		
		$map['category'] = $categoryId;
		if(isset($_GET['id'])){
			$map['id'] = $_GET['id'];
		}
		
		return $map;				
	}
}
?>